/*
 * @Author: 邱狮杰
 * @Date: 2021-05-15 11:14:40
 * @LastEditTime: 2021-05-15 11:24:33
 * @FilePath: /weddingdress/src/page/selectionRecommendation/hooks/edit.ts
 * @Description: edit handler
 */

import { CSSProperties, useState, useEffect } from 'react'
export function useEdit<T extends Boolean>(dep: T): CSSProperties[] {
  const notEdited = { border: 'solid 1px #242424', color: '#222' }
  const [style, setStyle] = useState<CSSProperties>(notEdited)
  useEffect(() => {
    if (dep) setStyle({ border: 'solid 1px #e9734f', color: '#e9734f' })
    else setStyle({ border: 'solid 1px #242424', color: '#222' })
  }, [dep])
  return [style]
}
